package cn.com.xf.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.com.xf.dao.TblCheckMendDAO;
import cn.com.xf.domain.TblCheckMend;
import cn.com.xf.service.MendService;

@Service
public class MendServiceImpl implements MendService {

	@Autowired
	private TblCheckMendDAO checkMendDAO;
	
	@Override
	public TblCheckMend selectMendById(Long id) {
		return checkMendDAO.selectByPrimaryKey(id);
	}

	@Override
	public int insertMend(TblCheckMend mend) {
		checkMendDAO.insert(mend);
		return 0;
	}

	@Override
	public int deleteMend(Long id) {
		return checkMendDAO.deleteByPrimaryKey(id);
	}

	@Override
	public int updateMend(TblCheckMend mend) {
		return checkMendDAO.updateByPrimaryKey(mend);
	}

	@Override
	public List<TblCheckMend> selectMend(int begin, int pageSize,
			String year_month,String userid, String siteid, String deptid) {
		return checkMendDAO.select(begin, pageSize,year_month, userid, siteid, deptid);
	}

	@Override
	public int selectMendCount(String year_month,String userid, String siteid, String deptid) {
		return checkMendDAO.selectCount(year_month, userid, siteid, deptid);
	}

	@Override
	public List<TblCheckMend> selectExport(String year_Month,String siteid, String deptid, String userid ) {
		// TODO Auto-generated method stub
		return checkMendDAO.selectExport(year_Month,siteid, deptid, userid);
	}

	@Override
	public List<TblCheckMend> selectPersonMend(int begin, int pageSize, String year_month, String userid, String siteid,
			String deptid) {
		// TODO Auto-generated method stub
		return checkMendDAO.selectPerson(begin, pageSize, year_month, userid, siteid, deptid);
	}

	@Override
	public int selectPersonMendCount(String year_month, String userid, String siteid, String deptid) {
		// TODO Auto-generated method stub
		return checkMendDAO.selectPersonCount(year_month, userid, siteid, deptid);
	}

	@Override
	public int updateUserMend(TblCheckMend mend) {
		// TODO Auto-generated method stub
		return checkMendDAO.updateByPrimaryKeySelective(mend);
	}

	@Override
	public int updateToEdit(TblCheckMend mend) {
		// TODO Auto-generated method stub
		return checkMendDAO.updateToEdit(mend);
	}

	


}
